<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/resources/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:pe="http://primefaces.org/ui/extensions">


    <ui:define name="content">
        <h:outputStylesheet library="css" name="printing.css"></h:outputStylesheet>
        <h:panelGroup rendered="true" >
            <h:form>
                <p:panel id="panelPrint" styleClass="noBorder summeryBorder">
                    <f:facet name="header" >
                        <h:outputLabel value="1) Lab Investigation With Credit"/>
                       
                        <h:panelGrid columns="2" styleClass="noPrintButton" >
                            <h:outputLabel value="From Date"/>
                            <p:calendar id="frmDate" value="#{investigationMonthSummeryOwnController.fromDate}" navigator="true"  pattern="dd MMMM yyyy HH:mm:ss" >
                            </p:calendar>

                            <h:outputLabel value="To Date"/>
                            <p:calendar id="toDate" value="#{investigationMonthSummeryOwnController.toDate}" navigator="true" pattern="dd MMMM yyyy HH:mm:ss" >
                            </p:calendar>
                        </h:panelGrid>
                         <h:panelGrid columns="5">
                             <p:spacer width="60" height="1"/>
                            <p:commandButton id="btnRefresh" value="Refresh" ajax="false"  styleClass="noPrintButton"/>
                            <p:defaultCommand target="btnRefresh"/>

                            <p:commandButton ajax="false" value="Print"  styleClass="noPrintButton" >
                                <p:printer target="panelPrint" />
                            </p:commandButton>

                            <p:commandButton ajax="false" value="Excel"  styleClass="noPrintButton" >
                                <pe:exporter type="xlsx" target="ins"  fileName="Caashier2" subTable="true" />
                            </p:commandButton> 
                        </h:panelGrid>
                    </f:facet>

                    <p:dataTable id="ins" value="#{investigationMonthSummeryOwnController.itemDetails}" var="c" >                        
                        <f:facet name="header">
                            <h:outputLabel value="Investigation Month End Detail" />
                            <h:outputLabel value=" From : " style="white-space: pre-line"/>
                            <h:outputLabel  value="#{investigationMonthSummeryOwnController.fromDate}">
                            <f:convertDateTime pattern="dd MM yyyy hh:mm:ss a"/>
                        </h:outputLabel>
                        <h:outputLabel value="&emsp;&emsp;To :"/>
                        <h:outputLabel  value="#{investigationMonthSummeryOwnController.toDate}" >
                            <f:convertDateTime pattern="dd MM yyyy hh:mm:ss a"/>
                        </h:outputLabel>
                        </f:facet>
                        <p:subTable value="#{c.billItems}" var="bc">

                            <f:facet name="header">
                                <h:outputLabel style="font-weight: bold;" value="#{c.investigation.name}"/>
                            </f:facet>

                            <p:column >                               
                                <h:outputLabel value="#{bc.bill.insId}"/>
                            </p:column>

                            <p:column>                              
                                <h:outputLabel value="#{bc.createdAt}">
                                    <f:convertDateTime pattern="dd MMMM YYYY"/>
                                </h:outputLabel>
                            </p:column>

                            <p:column>                                
                                <h:outputLabel value="#{bc.bill.patient.person.name}"/>
                            </p:column>
                            <p:column>                                
                                <h:outputLabel value="#{bc.netValue}"/>
                            </p:column>
                        </p:subTable>
                <f:facet name="footer" >
                    <h:outputLabel value="Printed By : #{sessionController.loggedUser.webUserPerson.name}" style="float: right"/>
                </f:facet>
                    </p:dataTable>

                </p:panel>        
            </h:form>
        </h:panelGroup>
    </ui:define>

</ui:composition>
